package com.dimples.dd.system.model.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.List;
import java.util.Objects;

/**
  *
  * @author zhongyj <1126834403@qq.com><br/>
  * @date 2025/1/10
  */
@Schema(description = "数据字典精简 Response VO")
@Data
public class DictDataSimpleRespVO {

    @Schema(description = "字典名称")
    private String name;

    @Schema(description = "字典编码")
    private String dictCode;

    @Schema(description = "字典数据集合")
    private List<DictData> dictDataList;

    @Schema(description = "字典数据")
    @Getter
    @Setter
    public static class DictData {

        @Schema(description = "字典类型")
        private String dictType;

        @Schema(description = "字典键值")
        private String value;

        @Schema(description = "字典标签")
        private String label;

        @Schema(description = "颜色类型，default、primary、success、info、warning、danger")
        private String colorType;

        @Schema(description = "css 样式")
        private String cssClass;
    }

    @Override
    public boolean equals(Object o) {
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        DictDataSimpleRespVO that = (DictDataSimpleRespVO) o;
        return Objects.equals(name, that.name) && Objects.equals(dictCode, that.dictCode);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, dictCode);
    }
}
